<?php
/**
 * Created by PhpStorm.
 * User: STICKYQU
 * Date: 2016/7/7
 * Time: 17:11
 */



use app\models\Configs;

require '../bootstrap.php';
require '../models/Configs.php';
//$appname,$description,$domains,$usertypes
/*
$appname= trim($_POST['appname']);
$description = trim($_POST['description']);
$domains = trim($_POST['domains']);
$usertypes = trim($_POST['usertypes']);
*/

$appname= trim($_POST['appname']);
$description = trim($_POST['description']);
$domains = trim($_POST['domains']);
$usertypes = trim($_POST['usertypes']);

$id = Configs::register($appname,$description,$domains,$usertypes);
if(! empty($id) ){
    echo json_encode(array('code' => 0, 'data' => $id));
}else{
    //登录失败
    echo json_encode(array('code' => -1));
}
